#lang rosetta-racket


(provide uniform-scale-origin
         uniform-scales-origin
         nonuniform-scale-origin
         nonuniform-scales-origin
         
         uniform-scale-center
         uniform-scales-center
         nonuniform-scale-center
         nonuniform-scales-center)


(define (uniform-scale-origin)
  (lift
   (thunk (displayln "Uniform scaling around the origin of a single sphere"))
   (scale (xyz 0.25 0.25 0.25) (sphere (x 10) 10))))

(define (uniform-scales-origin)
  (lift
   (thunk (displayln "Uniform scaling around the origin of two spheres"))
   (scale
    (xyz 0.25 0.25 0.25)
    (list
     (sphere (x 10) 10)
     (sphere (x -5) 5)))))

(define (nonuniform-scale-origin)
  (lift
   (thunk (displayln "Non-uniform scaling around the origin of a single sphere"))
   (scale (xyz 0.25 1 1) (sphere (x 10) 10))))

(define (nonuniform-scales-origin)
  (lift
   (thunk (displayln "Non-uniform scaling around the origin of two spheres"))
   (scale
    (xyz 0.25 1 1)
    (list
     (sphere (x 10) 10)
     (sphere (x -5) 5)))))


(define (uniform-scale-center)
  (lift
   (thunk (displayln "Uniform scaling of a single sphere around its center"))
   (scale-center (xyz 0.25 0.25 0.25) (sphere (x 10) 10))))

(define (uniform-scales-center)
  (lift
   (thunk (displayln "Uniform scaling of two spheres around the center of each"))
   (scale-center
    (xyz 0.25 0.25 0.25)
    (list
     (sphere (x 10) 10)
     (sphere (x -5) 5)))))

(define (nonuniform-scale-center)
  (lift
   (thunk (displayln "Non-uniform scaling of a single sphere around its center"))
   (scale-center (xyz 0.25 1 1) (sphere (x 10) 10))))

(define (nonuniform-scales-center)
  (lift
   (thunk (displayln "Non-uniform scaling of two spheres around the center of each"))
   (scale-center
    (xyz 0.25 1 1)
    (list
     (sphere (x 10) 10)
     (sphere (x -5) 5)))))